package javanio.buffer;

import java.nio.ByteBuffer;

/**
 * Created by IntelliJ IDEA.
 * User: liuliwei
 * Date: 2017-09-18
 * Time: 上午11:10
 * Description: ${description}
 */
public class ByteBufferTest {
    public static void main(String[] args) {
        ByteBuffer byteBuffer = ByteBuffer.allocate(3);
        byteBuffer.put((byte)'a');
//        byteBuffer.flip();
        System.out.println(byteBuffer.position(0));
        System.out.println(byteBuffer.limit());
        System.out.println(byteBuffer.capacity());
        System.out.println(byteBuffer.get());
        System.out.println(byteBuffer);
    }
}
